<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">

	var arr = [45,3,3,567,3,36,6,345];
	/**
	 * [getMax 求最大值]
	 * @Author   Xuebingsi
	 * @DateTime 2017-10-26T08:27:24+0800
	 * @param    {[type]}                 data [description]
	 * @return   {[type]}                      [description]
	 */
	function getMax (data) {
		var max = data[0];

		for (var i = 0; i <=data.length; i++) {
			if(data[i]>max){
				max = data[i];
			}
		};

		return max;
	}


	var max = getMax(arr);


	var  arr = [4,3,6,4,4,4,4,2,7,2,242,63,3,33];

	function quchong(data){
		for (var i = 0; i < data.length; i++) {
			for (var j = i+1; j < data.length; j++) {

				if(data[i]==data[j]){
					data.splice(j, 1);
					j--;
				}
			};
		};

		return data;
	}

	var res = quchong(arr);

	// alert(res);



	arr = [345,7,34,78,73,67,78,4,3];


	for (var i = 0; i < arr.length; i++) {
		if(arr[i]%2==1){
			arr[i] = arr[i]*2;
		}
	};

	// alert(arr);


	arr = [4,7,0,3,8,1,2,9,5];


	for (var i = 0; i < arr.length; i++) {
		for (var j = 0; j< arr.length; j++) {
			
			if(arr[j]>arr[j+1]){
				temp = arr[j+1];
				arr[j+1] =arr[j];
				arr[j] =temp; 
			}
		};
	};
	alert(arr)







	




	</script>
</head>
<body>
	
</body>
</html>